package com.naire.modul.survey_org.action;

import java.util.ArrayList;
import java.util.List;

import net.common.action.GeneralAction;
import com.naire.modul.survey_org.service.Survey_orgDeleteService;
import com.naire.modul.survey_org.service.Survey_orgEditorService;
import com.naire.modul.survey_org.service.Survey_orgFindService;
import com.naire.modul.survey_org.service.Survey_orgSearchService;
import com.naire.modul.survey_org.vo.Survey_orgVo;

public class Survey_orgAction extends GeneralAction {

	private static final long serialVersionUID = 7127573666355745443L;

	private Survey_orgVo bean = new Survey_orgVo();
	private List<Survey_orgVo> list = new ArrayList<Survey_orgVo>();
	
	public String search() throws Exception {
		Survey_orgSearchService service = new Survey_orgSearchService();
		service.setPageBean(pageBean);
		service.setProject_id(bean.getProject_id());
		service.invoke();
		list = service.getList();
		return SUCCESS;
	}
	
	public String editor() throws Exception {
		Survey_orgEditorService service = new Survey_orgEditorService();
		service.setBean(bean);
		service.invoke();
		return SUCCESS;
	}
	
	public String find() throws Exception {
		if(bean.getSurvey_id() != null) {			
			Survey_orgFindService service = new Survey_orgFindService();
			service.setId(bean.getSurvey_id());
			service.invoke();
			bean = service.getBean();
		}
		return SUCCESS;
	}
	
	public String delete() throws Exception {
		Survey_orgDeleteService service = new Survey_orgDeleteService();
		service.setBean(bean);
		service.invoke();
		return SUCCESS;
	}
	
	public Survey_orgVo getBean() {
		return bean;
	}
	public void setBean(Survey_orgVo bean) {
		this.bean = bean;
	}
	public List<Survey_orgVo> getList() {
		return list;
	}
	public void setList(List<Survey_orgVo> list) {
		this.list = list;
	}
}
